#pragma once

#include <linux/input.h>

namespace Input
{

namespace Evdev
{
	static const uint
	UP = KEY_UP,
	DOWN = KEY_DOWN,
	LEFT = KEY_LEFT,
	RIGHT = KEY_RIGHT,

	GAME_A = BTN_A,
	GAME_B = BTN_B,
	GAME_C = BTN_C,
	GAME_X = BTN_X,
	GAME_Y = BTN_Y,
	GAME_Z = BTN_Z,
	GAME_L1 = BTN_TL,
	GAME_R1 = BTN_TR,
	GAME_L2 = BTN_TL2,
	GAME_R2 = BTN_TR2,
	GAME_LEFT_THUMB = BTN_THUMBL,
	GAME_RIGHT_THUMB = BTN_THUMBR,
	GAME_START = BTN_START,
	GAME_SELECT = BTN_SELECT,
	GAME_MODE = BTN_MODE,

	GAME_1 = BTN_TRIGGER, GAME_2 = BTN_THUMB, GAME_3 = BTN_THUMB2, GAME_4 = BTN_TOP, GAME_5 = BTN_TOP2, GAME_6 = BTN_PINKIE,
	GAME_7 = BTN_BASE, GAME_8 = BTN_BASE2, GAME_9 = BTN_BASE3, GAME_10 = BTN_BASE4, GAME_11 = BTN_BASE5, GAME_12 = BTN_BASE6,
	GAME_13 = BTN_BASE6+1, GAME_14 = BTN_BASE6+2, GAME_15 = BTN_BASE6+3, GAME_16 = BTN_DEAD,

	// Our own key-codes for analog -> digital joystick axis emulation
	JS1_XAXIS_POS = KEY_MAX+1, JS1_XAXIS_NEG = KEY_MAX+2,
	JS1_YAXIS_POS = KEY_MAX+3, JS1_YAXIS_NEG = KEY_MAX+4,

	JS2_XAXIS_POS = KEY_MAX+5, JS2_XAXIS_NEG = KEY_MAX+6,
	JS2_YAXIS_POS = KEY_MAX+7, JS2_YAXIS_NEG = KEY_MAX+8,

	JS3_XAXIS_POS = KEY_MAX+9, JS3_XAXIS_NEG = KEY_MAX+10,
	JS3_YAXIS_POS = KEY_MAX+11, JS3_YAXIS_NEG = KEY_MAX+12,

	JS_LTRIGGER_AXIS = KEY_MAX+13, JS_RTRIGGER_AXIS = KEY_MAX+14;

	static const uint EX_KEYS = 14;
	static const uint COUNT = KEY_CNT + EX_KEYS;
}

const char *evdevButtonName(Key b);

}
